<script setup>
import { inject, ref } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";

onLoad((e) => {
  status.value = e.status;
});
const status = ref();

// uni.navigateBack(2)

// 返回提货
const goGoorder = () => {
  // uni.navigateBack()
  uni.reLaunch({ url: "/pages/cloudlibrary/takegood/index" });
  // let pages = getCurrentPages();

  // 获取页面栈的长度，即页面跳转层级
  // let level = pages.length;

  // if (level > 1) {
  //   uni.navigateBack();
  // } else {
  //   uni.switchTab({
  //     url: "/pages/my/index",
  //   });
  // }
};

// 查看订单
const goOrder = () => {
  uni.navigateTo({
    url: "/pages/order/orderlist/index?status=1",
  });
};
</script>
<template>
  <view class="paycontent">
    <view class="pay-hx" v-if="status == 200"> </view>
    <view class="pay-hx pay-err" v-else> </view>
    <view class="pay-res" v-if="status == 200">
      <view class="pay-res-img">
        <image src="@/static/icon_successful.png" mode=""></image>
      </view>
      <view class="pay-res-name"> 提货成功 </view>
      <view class="pay-res-dec"> 订单可至“我的-全部订单”查看 </view>
      <view class="pay-res-k">
        <view class="pay-res-see" @click="goGoorder"> 返回提货 </view>
        <view class="pay-res-bt" @click="goOrder"> 查看订单 </view>
      </view>
    </view>

    <view class="pay-res" v-else>
      <view class="pay-res-img">
        <image src="@/static/icon_error.png" mode=""></image>
      </view>
      <view class="pay-res-name"> 提货失败 </view>
      <view class="pay-res-dec"> 提交失败,请重新提交 </view>
      <view class="pay-res-k">
        <view class="pay-res-see refresh-pay" @click="goGoorder"> 返回 </view>
      </view>
    </view>
  </view>
</template>

<style lang="scss" scoped>
@import "index.scss";
</style>
